package cn.edu.scnu.lastandroid.logic.network

import cn.edu.scnu.lastandroid.WeatherApplication
import cn.edu.scnu.lastandroid.logic.model.AQIResponse
import cn.edu.scnu.lastandroid.logic.model.DailyResponse
import cn.edu.scnu.lastandroid.logic.model.LifeResponse
import cn.edu.scnu.lastandroid.logic.model.RealtimeResponse
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface WeatherService {
//    按照城市获取天气
    /**
     * 按照城市获取实时天气
     */
    @GET("v7/weather/now?key=${WeatherApplication.PrivateKey}")
    fun getRealTimeWeather(@Query("location") city:String): Call<RealtimeResponse>

    /**
     * 按照城市获取多日天气
     */
    @GET("v7/weather/7d?key=${WeatherApplication.PrivateKey}")
    fun getDailyWeather(@Query("location") city: String): Call<DailyResponse>

//    按照经纬度获取天气
    /**
     * 按照经纬度获取实时天气
     */
    @GET("v7/weather/now?key=${WeatherApplication.PrivateKey}")
    fun getRealTimeWeather(@Query("location") lng:String, lat:String):Call<RealtimeResponse>

    /**
     * 按照经纬度获取多日天气
     */
    @GET("v7/weather/7d?key=${WeatherApplication.PrivateKey}")
    fun getDailyWeather(@Query("location") lng: String, lat: String):Call<DailyResponse>

    /**
     * 按照城市获取生活指数
     */
    @GET("v7/indices/7d?key=${WeatherApplication.PrivateKey}")
    fun getLifeIndex(@Query("location") city: String):Call<LifeResponse>

    /**
     * 按照经纬度获取生活指数
     */
    @GET("v7/indices/7d?key=${WeatherApplication.PrivateKey}")
    fun getLifeIndex(@Query("location") lng: String, lat: String):Call<LifeResponse>

    /**
     * 按照城市获取空气质量
     */
    @GET("v7/air/now?key=${WeatherApplication.PrivateKey}")
    fun getAQI(@Query("location") city: String):Call<AQIResponse>

    /**
     * 按照经纬度获取空气质量
     */
    @GET("v7/air/now?key=${WeatherApplication.PrivateKey}")
    fun getAQI(@Query("location") lng: String, lat: String):Call<AQIResponse>
}